package com.tianji.learning.mapper;

import com.tianji.learning.domain.po.LearningLesson;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 学生课表 Mapper 接口
 * </p>
 *
 * @author Ys
 * @since 2023-08-06
 */
public interface LearningLessonMapper extends BaseMapper<LearningLesson> {

    //统计本周计划学习小节数
    @Select("select ifnull(sum(week_freq),0) from learning_lesson wherre user_id = #{userId} and plan_status = 1 " +
            "and status in (0,1)")
    Integer getWeekTotalPlan(Long user);
}
